// 注册路由
export const createRouter = function (router, controllerFiles) {
    // console.log(`TEXT! createRouter: ${controllerFiles}`);
    
    controllerFiles.forEach(async item => {
        let arr = await import(item);
        console.log(`TEXT! createRouter: ${arr.object}`);
        
        arr.object.forEach(obj => {
            console.log(obj.function);
            
0           // console.log(`TEXT! forEach ${obj.method,obj.url,obj.function}`);
            if (obj.method === 'get') {
                router.get(obj.url, obj.function);
            }
            if (obj.method === 'post') {
                router.post(obj.url, obj.function);
            }
            if (obj.method === 'put') {
                router.put(obj.url, obj.function);
            }
            if (obj.method === 'del') {
                router.delete(obj.url, obj.function);
            }
        })
    });
}


